# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=dolphin
pkgver=20.04.3
pkgrel=0
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://kde.org/applications/system/dolphin"
pkgdesc="KDE File Manager"
license="GPL-2.0-only"
depends="udisks2 kio-extras"
depends_dev="qt5-qtbase-dev kdoctools-dev kinit-dev kcmutils-dev knewstuff-dev
	kcoreaddons-dev ki18n-dev kdbusaddons-dev kbookmarks-dev kconfig-dev
	kio-dev kparts-dev solid-dev kiconthemes-dev kcompletion-dev
	ktextwidgets-dev knotifications-dev kcrash-dev kwindowsystem-dev
	phonon-dev baloo-dev baloo-widgets-dev kfilemetadata-dev kactivities-dev"
makedepends="$depends_dev extra-cmake-modules ruby-test-unit"
checkdepends="xvfb-run dbus"
source="https://download.kde.org/stable/release-service/$pkgver/src/dolphin-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	# kfileitemmodeltest, placesitemmodeltest and dolphinmainwindowtest are broken
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "(kfileitemmodel|placesitemmodel|dolphinmainwindow)test"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="fc4ad5ff645387d7a058cff42db00d55db8b0cb7793cdc3adbbaff2e8465c469a5ad6040625bfde564e18c25c16ae3962d6eb7ac9618e0ae8783a2fe030fc5ca  dolphin-20.04.3.tar.xz"
